﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ProyectoLab4
{
    public partial class MailViejo : System.Web.UI.Page
    {

        GestionMails Mail = new GestionMails();
        GridView TraerMail = new GridView();
        String loginUsuario;
        String consulta;

        protected void Page_Load(object sender, EventArgs e)
        {
            consulta = "SELECT * FROM Bandeja_Mails WHERE id_mail='"+ Request.QueryString["id"] + "'";
            Mail.CargarBandeja(consulta, ref TraerMail);
            lblRemitente.Text = TraerMail.Rows[0].Cells[1].Text;
            lblDestinatario.Text = TraerMail.Rows[0].Cells[2].Text;
            lblAsunto.Text = TraerMail.Rows[0].Cells[3].Text;
            lblMensaje.Text = TraerMail.Rows[0].Cells[4].Text;
        }

        protected void btnResponder_Click(object sender, EventArgs e)
        {
            Response.Redirect("MailNuevo.aspx?id=" + TraerMail.Rows[0].Cells[0].Text);
        }
    }
}
